<?php if (hasPermission("namespaces.object.create.page")): ?>
	<?php $this->append ("scripts", "newblogentry") ?>
	
	<form action="<?php echo Gene::makeLink($object) ?>/new/blogentry" method="post">
	
	<fieldset>
	<legend>Create Blog Entry</legend>
	
	<?php if ($draft): ?>
		<input type="hidden" name="draftid" value="<?php echo $draft['draft_id'] ?>" />
	<?php endif; ?>
	
	<p class="fieldlabel"><label for="entrytitle">Entry Title:</label></p>
	<p class="field"><input type="text" id="entrytitle" name="objtitle" size="32" class="required" value="<?php _e($title) ?>" /></p>
	
	<p class="fieldlabel"><label for="formobjcontent">Message:</label></p>
	<p class="field"><?php $this->display('objects/enhancedinput', array('rows' => 12, 'required' => true, 'type' => 'blog')) ?></p>
	
	<p class="fieldlabel">Categories:</p>
	<p class="field"><span id="entrycategories">
	<?php foreach ($categories as $i): ?>
		<label><input name="categories[]" type="checkbox" value="<?php _e($i['label']) ?>" <?php if (isset($options['categories']) && in_array($i['label'], $options['categories'])): ?>checked="checked"<?php endif; ?> /><?php _e($i['label']) ?> (<?php echo $i['objects'] ?>)</label><br />
	<?php endforeach; ?></span><span id="extracategories"></span></p>
	
	<p class="formcontrols">
	<input type="submit" value="Publish Entry" class="btn_focus" />
	
	<?php if ($draft || getUserProperty('drafts') < Gene::getSetting('maximum_drafts')): ?>
		<input type="submit" name="draft" value="Save Draft" class="btn_minor skipcheck" />
	<?php endif; ?>
	</p>
	
	</fieldset>
	
	</form>
<?php endif; ?>